#region Microsoft Public License
/*
 * (c) Copyright Chenjun Wu. http://utablesdk.codeplex.com
 * 
 * This source is subject to the Microsoft Public License (Ms-PL).
 * Please see http://go.microsoft.com/fwlink/?LinkID=131993 for details.
 * All other rights reserved.
 */
#endregion

﻿using System;
using System.Windows;

namespace UTable.Objects
{
    /// <summary>
    /// The interface for visual tree implementations
    /// A visual tree provides basic description information about the tree
    /// </summary>
    public interface IVisualTree
    {
        /// <summary>
        /// Get this tree's height
        /// </summary>
        IVisualNode TreeRoot { get; }

        /// <summary>
        /// Get this tree's width
        /// </summary>
        double TreeWidth { get; }

        /// <summary>
        /// Get this tree's height
        /// </summary>
        double TreeHeight { get; }

        /// <summary>
        /// Get the node by its id
        /// </summary>
        IVisualNode GetNodeByID(String id);
     
        /// <summary>
        /// Get the node's parent
        /// </summary>
        IVisualNode GetParent(IVisualNode node);

        /// <summary>
        /// Get the node's ith child
        /// </summary>
        IVisualNode GetChild(IVisualNode node, int index);

        /// <summary>
        /// Get the number of children of the node
        /// </summary>
        int GetChildrenCount(IVisualNode node);

        /// <summary>
        /// Do hit test on this tree
        /// </summary>
        HitTestResult HitTest(HitTestParameters hitTestParameters);

        /// <summary>
        /// Translate the point in the tree's coordinate to the coordinate of the relative node
        /// </summary>
        Point TranslatePoint(Point point, IVisualNode relativeTo);

        /// <summary>
        /// Translate the point in node's coordinate to the coordinate of the relative node
        /// </summary>
        Point TranslatePoint(IVisualNode node, Point point, IVisualNode relativeTo);
    }
}
